/**
 * 保存memberCircle时，更新memberTotal
 */
Parse.Cloud.beforeSave('RcMemberCircle', (req, res) => {
  try {
    const memberCircle = req.object
    if (memberCircle.id) return

    const circle = memberCircle.get('circle')
    circle.increment('memberTotal', 1)
    circle.save()
  } catch (err) {
    console.log(err)
  } finally {
    res.success()
  }
})
